var path = require('path');
var node_modules_dir = path.join(__dirname, 'node_modules');
var webpack = require('webpack');

//noparse 只可以用于不设置 amd/cmd模块化的源码例如jquery
var config = {
  entry:  path.resolve(__dirname, './app/main.js'),
  resolve: {
    alias: {}
  },
  output: {
    path: path.resolve(__dirname, './build'),
    filename: 'bundle.js'
  },
  devServer:{
    historyApiFallback:true,
    hot:true,
    port:9090 //端口你可以自定义
},
  module: {
    loaders: [{
      test: /\.jsx?$/,
      loader: 'babel-loader',
      exclude:/node_modules/,
      query:{
      	presets:['es2015','react']
      }
    }, {
      test: /\.css$/,
      loader: 'style-loader!css-loader'
    }, {
      test: /\.less$/,
      loader: 'style-loader!css-loader!less-loader'
    },
     {
      test: /\.scss$/,
      loader: 'style-loader!css-loader!sass-loader'
    },
    {
      test: /\.(png|jpg)$/, 
      loader: 'url?limit=25000' 
    }]
  },
   plugins: [
    new webpack.HotModuleReplacementPlugin()
  ]
};



module.exports = config;

